<template>
	<!-- 收付款记录 -->
	<view class="shell_wp">
		<view class="shell_detailed">
			<view>今日{{headInfo.curDay}}</view> 
			<view>昨日{{headInfo.yesDay}}</view>
			<view>本月{{headInfo.curMoth}}</view>
			<view>上月{{headInfo.priMoth}}</view>
		</view>
		<view class="shell_list">
			<view class="shell_item" v-for="(item,i) in list" :key="i">
				<view class="shell_li">
					<text class="shell_li_title" style="color: #027908;">{{item.title}}</text>
					<text>实付：<text class="s_money" style="color: #666;">{{item.price}}</text></text>
				</view>
				<view class="shell_li">
					<view class="shell_flex">
						<text class="shell_flex_title">付款人：<text class="s_remarks">{{item.remark}}</text></text>
						<view @click="phone(item.mobile)" v-if="item.mobile!=''"><uni-icons color="#8405dc" type="phone-filled" size="18"></uni-icons></view>
					</view>
					<text>结算价：<text class="s_money" style="color: #8405dc;">{{item.realprice}}</text></text>
				</view>
				<view class="shell_li">
					<text class="shell_li_title ">付款时间：<text style="color: #999;">{{item.createtime}}</text></text>
				</view>
				<view class="shell_li">
					<text  class="shell_li_title ">核销时间：<text style="color: #999;">{{item.checktime}}</text></text>
				</view>
				<view class="shell_li">
					<text class="shell_li_title" v-if="item.checkmid>0">核销店员： <text style="color: #8405dc;">【{{item.checkname}}】<text v-if="item.checkmid>0">({{item.checkmid}})</text></text></text>
				</view>
				<view class="shell_li">
					<text class="shell_li_title ">应返金额：<text style="color: #8405dc;">{{item.ratesupmoney}}</text></text>
				</view>
				<view class="shell_li">
					<text class="shell_li_title ">已返金额：<text style="color: #8405dc;">{{item.returnmoney}}</text></text>
					<text>状态：<text class="s_money" style="color: #999;" v-if="!item.status">冻结中</text><text class="s_money" style="color: #8405dc;" v-else>已发放</text></text>
				</view>
			</view>
		</view>
		<view class="loading_message">
			<image v-if="isloading" src="../../static/business/loading.gif"></image>
			<view v-if="isempty">到底了~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page: 0,
				list: [],
				isempty: false,
				isloading: false,
				headInfo:[],
			}
		},
		onReachBottom() {
			this.getilist();
		},
		onLoad() {
			this.getilist();
			this.headIncome();
		},
		methods: {
			getilist() {
				this.page += 1;
				this.isloading = true;
				this.$axios('transLog/incomegroup', 'POST', 'bonus', {
					page: this.page
				}).then(res => {
					this.isloading = false;
					if (res.data.code == 200) {
						let length = res.data.data.length;
						this.list = this.list.concat(res.data.data);
						this.isempty = length <= 0 ? true : false;
					}
				})
			},
			headIncome() {
				this.page += 1;
				this.isloading = true;
				this.$axios('transLog/headIncomegroup', 'POST', 'bonus', {
					page: this.page
				}).then(res => {
					this.isloading = false;
					if (res.data.code == 200) {
						this.headInfo = res.data.data;
					}
				})
			},
			phone(phone){
				uni.makePhoneCall({
					phoneNumber: phone //仅为示例
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f2f2f2;
		color: $font-color-dark;
	}

	.shell_wp {
		padding-bottom: 100upx;
	}
	.shell_flex{
		display: flex;
		flex: 1;
		align-items: center;
		.shell_flex_title{
			margin-right: 10rpx;
			font-weight: bold;
		}
	}
	.title {
		font-size: 34upx;
		font-weight: bold;
		padding-top: 14upx;
		display: flex;
		justify-content: center;
		// vertical-align:middle;
	}
	.title2 {
		font-size: 28upx;
		color:#555 ;
		font-weight: bold;
		padding-top: 10upx;
		display: flex;
		justify-content: center;
		// vertical-align:middle;
	}
	.shell_detailed {
		font-size: 32upx;
		color:#333 ;
		font-weight: bold;
		// right: 10upx;
		// left: 10upx;
		padding: 10upx 30upx 10upx 30upx;
		display: flex;
		// justify-content:space-around;	
		justify-content: space-between;
		// vertical-align:middle;
	}

	.shell_item {
		background-color: #fff;
		border-radius: 10upx;
		padding: 20upx;
		margin: 0 20upx 20upx;
	}

	.shell_li {
		display: flex;
		align-items: center;
	}

	.shell_li text {
		line-height: 40upx;
	}

	.s_time {
		color: $font-color-light;
	}

	.shell_li_title {
		flex: 1;
		margin-right: 10upx;
		font-weight: bold;
	}

	.s_money {
		font-weight: bold;
		color:#f03201 ;
	}

	.s_remarks {
		color: #999;
	}

	.loading_message image {
		display: block;
		margin: 0 auto;
		height: 60upx;
		width: 60upx;
	}

	.loading_message view {
		text-align: center;
		color: $font-color-spec;
	}
</style>